#!/bin/sh

if snapctl is-connected upower-observe; then
    dbus-send \
      --print-reply \
      --system \
      --dest=org.freedesktop.UPower \
      /org/freedesktop/UPower \
      org.freedesktop.UPower.EnumerateDevices \
         > "$SNAP_COMMON/enumerate.txt" 2>&1
else
    echo "upower-observe not connected" > "$SNAP_COMMON/enumerate.txt"
fi
